package com.tech.cloudapp.db.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.tech.cloudapp.db.mapper.UserAnswerResultMapper;
import com.tech.cloudapp.db.service.UserAnswerResultService;
import com.tech.cloudapp.po.UserAnswerResultParamPO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.context.annotation.Primary;
import org.springframework.stereotype.Service;

import java.util.List;

@Primary
@Service
public class UserAnswerResultServiceImpl implements UserAnswerResultService {

    @Qualifier("userAnswerResultMapper")
    @Autowired
    private UserAnswerResultMapper userAnswerResultMapper;

    @Override
    public UserAnswerResultParamPO.UserAnswerResultPO getResult(UserAnswerResultParamPO userAnswerResultParamPO) {
        return userAnswerResultMapper.result(userAnswerResultParamPO);
    }

    @Override
    public List<UserAnswerResultParamPO.UserScoreSortResultPO> getScores() {
        return userAnswerResultMapper.scoreRange();
    }
}
